/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.machineryrental.dao;

import cz.muni.fi.pa165.machineryrental.entities.Machine;
import java.util.List;

/**
 *
 * @author Marian Lorenc, 374122
 */
public interface MachineDAO {
    /**
     * Return Machine by given id
     * @param id is ID of the searched machine.
     * @return 
     */
    public Machine getById(long id);    
    
    /**
     * Create new Machine in database
     * @param machine is the machine to insert into database
     */
    public void create(Machine machine);
    
    /**
     * Update given machine 
     * @param machine is the machine to update
     */
    public void update(Machine machine);
    
    /**
     * Remove given machine
     * @param machine is the machine to remove
     */
    public void remove(Machine machine);
    
    /**
     * Return all machines
     * @return list of all machines in database
     */
    public List<Machine> findAll();
    
    /**
     * Return machine by given code
     * @param code code of the searched Machine
     * @return Machine with given code
     */
    public Machine findByCode(String code);
    
    /**
     * Return machines with given brand
     * @param brand brand of searched machines
     * @return list of machines with given brand
     */
    public List<Machine> findByBrand(String brand);
    
    /**
     * 
     * @param year is year in which the searched machines were made.
     * @return list of machines with given year
     */
    public List<Machine> findByYear(int year);
    
}
